-
Notifications
You must be signed in to change notification settings - Fork 2.6k
docs(nx-dev): add astro sitemap to nx.dev #32709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
View your CI Pipeline Execution ↗ for commit e888dba
☁️ Nx Cloud last updated this comment at |
74e6d63
to
b0f90ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nx Cloud is proposing a fix for your failed CI:
We fixed the TypeError in the internal link checker script by updating the readSiteMapIndex function to handle both single and multiple sitemap entries, and added error handling in readSiteMapLinks to gracefully handle missing sitemap files. This resolves the build failure that was preventing the nx-dev:build task from completing successfully.
We verified this fix by re-running nx-dev:build
.
Suggested Fix changes
diff --git a/scripts/documentation/internal-link-checker.ts b/scripts/documentation/internal-link-checker.ts
index eff6c05..66c3eb5 100644
--- a/scripts/documentation/internal-link-checker.ts
+++ b/scripts/documentation/internal-link-checker.ts
@@ -82,20 +82,31 @@ function readSiteMapIndex(directoryPath: string, filename: string): string[] {
const parser = new XMLParser();
const sitemapIndex: {
sitemapindex: {
- sitemap: {
- loc: string;
- };
+ sitemap:
+ | {
+ loc: string;
+ }
+ | {
+ loc: string;
+ }[];
};
} = parser.parse(readFileContents(join(directoryPath, filename)));
- return [
- join(
- directoryPath,
- sitemapIndex.sitemapindex.sitemap.loc.replace('https://nx.dev', '')
- ),
- ];
+
+ const sitemaps = Array.isArray(sitemapIndex.sitemapindex.sitemap)
+ ? sitemapIndex.sitemapindex.sitemap
+ : [sitemapIndex.sitemapindex.sitemap];
+
+ return sitemaps.map((sitemap) =>
+ join(directoryPath, sitemap.loc.replace('https://nx.dev', ''))
+ );
}
function readSiteMapLinks(filePath: string): string[] {
+ if (!existsSync(filePath)) {
+ console.warn(`Warning: Sitemap file does not exist: ${filePath}`);
+ return [];
+ }
+
const parser = new XMLParser();
const sitemap: {
urlset: {
⚙️ An Nx Cloud workspace admin can disable these reviews in workspace settings.
b0f90ad
to
e888dba
Compare
see new entry here: https://nx-dev-git-cu-doc-155-sitemaps-nrwl.vercel.app/sitemap.xml as exmaple Fixes DOC-155
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
see new entry here: https://nx-dev-git-cu-doc-155-sitemaps-nrwl.vercel.app/sitemap.xml as exmaple
Fixes DOC-155